home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / pascal / heap55.com / DEMO.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1990-01-07  |  499 b   |  21 lines

  1. (*
  2. This small program demonstrates the ability of the BADPTR unit to capture
  3. the use of bad pointers. To try it, first patch your copy of TPC.EXE by
  4. running HPAT55. Then compile this program with the patched copy of TPC.
  5. Finally run it and BADPTR will catch the attempt to make an assignment to
  6. the region of memory pointed to by the nil pointer P.
  7.  
  8. See HEAP.DOC for more information.
  9. *)
  10.  
  11. {$P+,D+,L+}
  12. program Demo;
  13. uses
  14.   badptr;
  15. var
  16.   p:^integer;
  17. begin
  18.   p:=nil;
  19.   p^:=1;
  20. end.
  21.